package com.whdh.demo01;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class B {
    public void write(String str) throws IOException {
        A a=new A();
        File file = new File(a.getTMP());
        if(file.exists()) {
            FileOutputStream fileOutputStream = new FileOutputStream(file, true);
            fileOutputStream.write(str.getBytes(StandardCharsets.UTF_8));
            fileOutputStream.close();
        }else {
            System.out.println("文件" + file.getPath() + "不存在");
        }
    }
}
